﻿using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuiLian.BigData.Hdl.Model
{
    /// <summary>
    /// 历史报警记录
    /// </summary>
    [Table(Name = "ad_hdl_scada_alarm_history")]
    public class HdlScadaAlarmHistoryEntity
    {
        /// <summary>
        /// 报警id
        /// </summary>
        [Column(IsPrimary = true)]
        public string _id { get; set; }

        ///// <summary>
        ///// 报警确认记录集合
        ///// </summary>
        //[Navigate(nameof(HdlScadaAlarmRealTimeAcrsEntity.alarmid))]
        //public List<HdlScadaAlarmRealTimeAcrsEntity> Acrs { get; set; }

        ///// <summary>
        ///// 报警通知记录
        ///// </summary>
        //[Navigate(nameof(HdlScadaAlarmRealTimeAnlsEntity.alarmid))]
        //public List<HdlScadaAlarmRealTimeAnlsEntity> Anls { get; set; }

        /// <summary>
        /// 报警类型(厂站报警/管网报警)
        /// </summary>
        public string atype { get; set; }

        /// <summary>
        /// 报警触发传感器编码
        /// </summary>
        public string code { get; set; }

        /// <summary>
        /// 是否确认
        /// </summary>
        public long? confirm { get; set; }

        /// <summary>
        /// 确认人
        /// </summary>
        public string confirmer { get; set; }

        /// <summary>
        /// 确认时间
        /// </summary>
        public long? confirmtime { get; set; }

        /// <summary>
        /// 触发时间
        /// </summary>
        public long? ctime { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        public string event_gdbh { get; set; }

        /// <summary>
        /// 工单状态
        /// </summary>
        public string event_gdzt { get; set; }

        /// <summary>
        /// 出单人
        /// </summary>
        public string event_uid { get; set; }

        /// <summary>
        /// 水厂编码
        /// </summary>
        public string factory { get; set; }

        /// <summary>
        /// 水厂名称
        /// </summary>
        public string fname { get; set; }

        /// <summary>
        /// 组织名称
        /// </summary>
        public string gname { get; set; }

        public long? grade { get; set; }

        /// <summary>
        /// 组织编码
        /// </summary>
        public string group { get; set; }

        /// <summary>
        /// 父级组织编码
        /// </summary>
        public string group_parent { get; set; }

        /// <summary>
        /// 父级组织名称
        /// </summary>
        public string group_parent_name { get; set; }

        /// <summary>
        /// 厂站(管网)信息
        /// </summary>
        public string info { get; set; }

        /// <summary>
        /// 报警级别
        /// </summary>
        public long? level { get; set; }

        /// <summary>
        /// 传感器名称
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 位置编码
        /// </summary>
        public string position { get; set; }

        /// <summary>
        /// 工艺编码
        /// </summary>
        public string process { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }

        /// <summary>
        /// 恢复时间
        /// </summary>
        public long? rtime { get; set; }

        /// <summary>
        /// 报警触发规则
        /// </summary>
        public string rules { get; set; }

        /// <summary>
        /// 简称
        /// </summary>
        public string sname { get; set; }

        /// <summary>
        /// 报警状态 0 恢复 1 报警
        /// </summary>
        public long? status { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public long? stime { get; set; }

        /// <summary>
        /// 触发次数
        /// </summary>
        public long? times { get; set; }

        /// <summary>
        /// 站点类型，对于厂站是水厂类型
        /// </summary>
        public string ty { get; set; }

        /// <summary>
        /// 站点类型名称
        /// </summary>
        public string tynm { get; set; }

        /// <summary>
        /// 指令状态
        /// </summary>
        public string zl_status { get; set; }

        #region rules info 站点信息

        public string station_id { get; set; }

        public string station_bm { get; set; }
        public string station_code { get; set; }
        public string station_name { get; set; }
        public string station_address { get; set; }
        public string station_position { get; set; }
        public string station_gdposition { get; set; }
        public string station_type { get; set; }
        public string station_typename { get; set; }
        public int? station_order { get; set; }

        #endregion

        #region rules info 传感器信息

        public string sensor_id { get; set; }
        public string sensor_code { get; set; }
        public string sensor_name { get; set; }
        public int? sensor_order { get; set; }

        #endregion
    }
}
